<?xml version="1.0" encoding="utf-8" ?>
<Elements Id="ea624809-0982-4e30-bde0-84b8ed93dfa4" xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomAction Id="Macaw.Wss4.GoogleAnalyticsSolution.GoogleAnalyticsConfigurationSettings"
                GroupId="SiteAdministration"
                Location="Microsoft.SharePoint.SiteSettings"
                Sequence="1000"
                Title="$Resources:Macaw.Wss4.GoogleAnalyticsSolution.GoogleAnalyticsConfigurationSettings,SiteSetting_CustomActionTitle"
                Description="$Resources:Macaw.Wss4.GoogleAnalyticsSolution.GoogleAnalyticsConfigurationSettings,SiteSetting_CustomActionDescription"
                UIVersion="4">
    <UrlAction Url="~site/_layouts/Macaw.Wss4.GoogleAnalyticsSolution/ManageGoogleAnalyticsSettings.aspx" />
  </CustomAction>

  <CustomAction Id="Macaw.Wss4.GoogleAnalyticsSolution.GoogleAnalyticsConfigurationSettings" Location="CommandUI.Ribbon">
    <CommandUIExtension>
      <CommandUIDefinitions>
        <CommandUIDefinition Location="Ribbon.WikiPageTab.PubPageActions.Controls._children">
          <Button
            Id="Ribbon.WikiPageTab.PubPageActions.GoogleAnalyticsConfigurationSettings"
            Sequence="100"
            Command="GoogleAnalyticsConfigurationSettings.Page"
            LabelText="$Resources:Macaw.Wss4.GoogleAnalyticsSolution.GoogleAnalyticsConfigurationSettings,PubPageAction_ButtonLabelText"
            Image16by16="/_layouts/Images/Macaw.Wss4.GoogleAnalyticsSolution/GoogleAnalytics16x16.png"
            Image32by32="/_layouts/Images/Macaw.Wss4.GoogleAnalyticsSolution/GoogleAnalytics32x32.png"
            ToolTipTitle="$Resources:Macaw.Wss4.GoogleAnalyticsSolution.GoogleAnalyticsConfigurationSettings,PubPageAction_ButtonTooltipTitle"
            ToolTipDescription="$Resources:Macaw.Wss4.GoogleAnalyticsSolution.GoogleAnalyticsConfigurationSettings,PubPageAction_ButtonTooltipDescription"
            TemplateAlias="o2" />
        </CommandUIDefinition>
      </CommandUIDefinitions>
      <CommandUIHandlers>
        <CommandUIHandler Command="GoogleAnalyticsConfigurationSettings.Page"
                          CommandAction="javascript:
                            function GoogleAnalyticsConfigurationSettingsCallback(dialogResult, returnValue)
                            {                         
                              
                            }                         
                         var options = {              
                           url: '/_layouts/Macaw.Wss4.GoogleAnalyticsSolution/ManageGoogleAnalyticsSettings.aspx?pageurl=' + escape(window.location),
                           tite: 'Manage Google Analytics for this Page',
                           allowMaximize: false,
                           showClose: true,
                           width: 800,
                           height: 550,
                           dialogReturnValueCallback: GoogleAnalyticsConfigurationSettingsCallback };
                         SP.UI.ModalDialog.showModalDialog(options);
                          " EnabledScript="true" />
      </CommandUIHandlers>
    </CommandUIExtension>
  </CustomAction>

  <CustomAction Id="Macaw.Wss4.GoogleAnalyticsSolution.GoogleAnalyticsConfigurationSettings.Library" Location="CommandUI.Ribbon">
    <CommandUIExtension>
      <CommandUIDefinitions>
        <CommandUIDefinition Location="Ribbon.WikiPageTab.LibrarySettings.Controls._children">
          <Button
            Id="Ribbon.WikiPageTab.LibrarySettings.GoogleAnalyticsConfigurationSettings"
            Sequence="100"
            Command="GoogleAnalyticsConfigurationSettings.Library"
            LabelText="$Resources:Macaw.Wss4.GoogleAnalyticsSolution.GoogleAnalyticsConfigurationSettings,LibrarySettings_ButtonLabelText"
            Image16by16="/_layouts/Images/Macaw.Wss4.GoogleAnalyticsSolution/GoogleAnalytics16x16.png"
            Image32by32="/_layouts/Images/Macaw.Wss4.GoogleAnalyticsSolution/GoogleAnalytics32x32.png"
            ToolTipTitle="$Resources:Macaw.Wss4.GoogleAnalyticsSolution.GoogleAnalyticsConfigurationSettings,LibrarySettings_ButtonTooltipTitle"
            ToolTipDescription="$Resources:Macaw.Wss4.GoogleAnalyticsSolution.GoogleAnalyticsConfigurationSettings,LibrarySettings_ButtonTooltipDescription"
            TemplateAlias="o1" />
        </CommandUIDefinition>
      </CommandUIDefinitions>
      <CommandUIHandlers>
        <CommandUIHandler Command="GoogleAnalyticsConfigurationSettings.Library"
                          CommandAction="javascript:
                            function GoogleAnalyticsConfigurationSettingsCallback(dialogResult, returnValue)
                            {                         
                              
                            }                         
                         var options = {              
                           url: '/_layouts/Macaw.Wss4.GoogleAnalyticsSolution/ManageGoogleAnalyticsSettings.aspx?listurl=' + escape(window.location),
                           tite: 'Manage Google Analytics for this Library',
                           allowMaximize: false,
                           showClose: true,
                           width: 800,
                           height: 550,
                           dialogReturnValueCallback: GoogleAnalyticsConfigurationSettingsCallback };
                         SP.UI.ModalDialog.showModalDialog(options);
                          " EnabledScript="true" />
      </CommandUIHandlers>
    </CommandUIExtension>
  </CustomAction>
  
</Elements>
